package housing.task2.db_exschange;

import housing.task3.dao.HsAddressDao;

import java.io.File;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: Linderhof
 * Date: 05.12.2010
 * Time: 2:23:23
 */
public class XmlExporter {
    public static void export(HsAddressDao dao, File file) {
        checkFile(file);

    }

    //creates file if it doesn't exist

    private static void checkFile(File file) {
        try {
            if (!file.exists()) {
                File dir = file.getParentFile();
                if (dir.mkdir()) {
                    if (file.createNewFile()) {
                        System.out.println("File " +
                                           file.getAbsolutePath() +
                                           " created");
                    }
                }

            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
